describe("practice-8-3",function(){
    it("一共有两种情况",function() {
        var arr_result = divide_equally_7_fish();
        expect(arr_result.length).toBe(2);
    });
    it("每个渔夫的获得7个筐",function() {
        var arr_result = divide_equally_7_fish();
        for(var i = 0;i <arr_result.length; i ++)
        {
            var divide_detail = arr_result[i];
            expect(divide_detail.fish_a.full + divide_detail.fish_a.half + divide_detail.fish_a.empty).toBe(7);
            expect(divide_detail.fish_b.full + divide_detail.fish_b.half + divide_detail.fish_b.empty).toBe(7);
            expect(divide_detail.fish_c.full + divide_detail.fish_c.half + divide_detail.fish_c.empty).toBe(7);
        }
    });
    it("每个渔夫的获得3.5筐鱼",function() {
        var arr_result = divide_equally_7_fish();
        for(var i = 0;i <arr_result.length; i ++)
        {
            var divide_detail = arr_result[i];
            expect(1*divide_detail.fish_a.full + 0.5*divide_detail.fish_a.half).toBe(3.5);
            expect(1*divide_detail.fish_b.full + 0.5*divide_detail.fish_b.half).toBe(3.5);
            expect(1*divide_detail.fish_c.full + 0.5*divide_detail.fish_c.half).toBe(3.5);
        }
    });
    it("符合平分鱼的每种情况都不相同",function() {
        var arr_result = divide_equally_7_fish();
        for(var i = 0;i <arr_result.length - 1; i ++)
        {
            var divide_detail = arr_result[i];
            var divide_detail_next = arr_result[i+1];
            var arr_detail = [divide_detail.fish_a.full,divide_detail.fish_b.full,divide_detail.fish_c.full];
            var arr_detail_next = [divide_detail_next.fish_a.full,divide_detail_next.fish_b.full,divide_detail_next.fish_c.full];
            var arr_tmp = [];
            for(var k = 0;k<arr_detail.length; k ++)
            {
                for(var m = 0; m < arr_detail_next.length; m ++)
                {
                    if(arr_detail[k] === arr_detail_next[m])
                    {
                        arr_tmp.push(m);
                        break;
                    }
                }
            }
            expect(arr_tmp.length != 3).toBe(true);
        }
    });
});